#include <iostream>

using namespace std;

template <class T>
T sum(T array[])
{
	T sum = 0;

	for (int i=0; i<5; i++) {
		sum += array[i];
	}

	return sum;
}

int main(void)
{
	int a[5] = {1, 2, 3, 4, 5};
	int s = sum<int>(a);
	cout << "Output: " << s;

	double d[5] = {1.5, 2.3, 3.2, 4.2, 5.3};
	double s_d = sum<double>(d);
	cout << "Output: " << s_d;

	return 0;
}
